package archer.framework.security.analog;

import archer.framework.security.token.Token;

/**
 * 虚拟登录绑定token到本地线程变量
 *
 * @author kent
 * @date 16/7/7.
 */
public class AnalogContextHolder {

    // 虚拟用户登录token
    private static final ThreadLocal<Token> analogTokenHolder = new ThreadLocal<>();

    public static Token get() {
        return analogTokenHolder.get();
    }

    public static void set(Token token) {
        analogTokenHolder.set(token);
    }

    public static void reset() {
        analogTokenHolder.remove();
    }
}
